/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entity;

import java.io.Serializable;
import java.math.BigInteger;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;

/**
 *
 * @author WinKiQue58
 */
@Embeddable
public class RulePK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "ID_RULE")
    private BigInteger idRule;
    @Basic(optional = false)
    @NotNull
    @Column(name = "ID_BRANCHENTERPRISE")
    private BigInteger idBranchenterprise;
    @Basic(optional = false)
    @NotNull
    @Column(name = "ID_ENTERPRISE")
    private BigInteger idEnterprise;

    public RulePK() {
    }

    public RulePK(BigInteger idRule, BigInteger idBranchenterprise, BigInteger idEnterprise) {
        this.idRule = idRule;
        this.idBranchenterprise = idBranchenterprise;
        this.idEnterprise = idEnterprise;
    }

    public BigInteger getIdRule() {
        return idRule;
    }

    public void setIdRule(BigInteger idRule) {
        this.idRule = idRule;
    }

    public BigInteger getIdBranchenterprise() {
        return idBranchenterprise;
    }

    public void setIdBranchenterprise(BigInteger idBranchenterprise) {
        this.idBranchenterprise = idBranchenterprise;
    }

    public BigInteger getIdEnterprise() {
        return idEnterprise;
    }

    public void setIdEnterprise(BigInteger idEnterprise) {
        this.idEnterprise = idEnterprise;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idRule != null ? idRule.hashCode() : 0);
        hash += (idBranchenterprise != null ? idBranchenterprise.hashCode() : 0);
        hash += (idEnterprise != null ? idEnterprise.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof RulePK)) {
            return false;
        }
        RulePK other = (RulePK) object;
        if ((this.idRule == null && other.idRule != null) || (this.idRule != null && !this.idRule.equals(other.idRule))) {
            return false;
        }
        if ((this.idBranchenterprise == null && other.idBranchenterprise != null) || (this.idBranchenterprise != null && !this.idBranchenterprise.equals(other.idBranchenterprise))) {
            return false;
        }
        if ((this.idEnterprise == null && other.idEnterprise != null) || (this.idEnterprise != null && !this.idEnterprise.equals(other.idEnterprise))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entity.RulePK[ idRule=" + idRule + ", idBranchenterprise=" + idBranchenterprise + ", idEnterprise=" + idEnterprise + " ]";
    }
    
}
